package com.banyuan.array;


//将一个数组首尾交换，这道题难点是交换的次数的判断

import java.util.Arrays;

public class FanZhuan {
    public static void main(String[] args) {
        int[] arr1 = new int[]{1, 2, 3, 4, 5, 6, 7};
        int temp = 0;
        for (int i = 0; i < arr1.length / 2; i++) {
            temp = arr1[i];
            arr1[i] = arr1[arr1.length - 1 - i];
            arr1[arr1.length - 1 - i] = temp;
        }
        System.out.println(Arrays.toString(arr1));
    }
}
